<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/common_head::commonHead('添加用户')"></head>
<body>
<div th:include="/common/common_js::commonJs"></div>
<div  align="center">
    <form id="ff" method="post" >
        <table cellpadding="5" class="zdtb">

            <input type="hidden" name="emp.id" id="empId" value="1" />
            <tr>
                <td colspan="2"  class="pwtb_title" style="	text-align: left;">员工信息</td>
            </tr>
            <tr>
                <td>姓名</td>
                <td><input class='easyui-textbox' type='text' name='emp.name' required="required"></input></td>
            </tr>
        </table>
    </form>
    <div style="text-align: center; padding: 5px">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">确&nbsp;&nbsp;定</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="close_tab()">关&nbsp;&nbsp;闭</a>
    </div>
</div>
<script type="text/javascript">

    function submitForm() {
        if ($("#ff").form("validate")) {
            $.ajax({
                type : "POST",
                url : currentPath+'/save',
                data : $('#ff').serialize(),
                dataType : "json",
                success : function(data) {
                    if (data.code == 'SUCCESS') {
                        $.messager.alert("提示", "保存成功");
                        $('#edit-dialog').dialog("close");
                        $("#topdatagrid").datagrid("reload");
                    } else {
                        $.messager.alert("提示", "[" + data.code + "] "
                                + data.description);
                    }
                }
            });
        }
    }
    function close_tab() {
        closeTab();
        var id = $("#empId").val();
        if (id == "" || id == null) {
            window.parent.$('#tt').tabs('close', '添加员工信息');
        } else {
            window.parent.$('#tt').tabs('close', '编辑员工信息');
        }
    }
</script>

</body>
</html>